import 'lodash';
import * as utils from '@pxxtech/utils';
import global from '@pxxtech/global';
import dictionary from '@pxxtech/dictionary/lib/local.js';

global.set({ dictionary });
// import { Login } from '@pxxtech/pro-mobile';
// import { districtTree } from '@pxxtech/global/es/district/tree';
// import { districtObject } from '@pxxtech/global/es/district/object';

// global.districtTree = districtTree;
// global.districtObject = districtObject;

// Login.config = {
//   agreementOptions: [
//     {
//       key: 'oidmda',
//       title: '运输服务协议',
//     },
//     {
//       key: 'kspxer',
//       title: '平行线隐私政策',
//     },
//     {
//       key: 'dr0u4p',
//       title: '平行线登录服务协议',
//     },
//   ],
// };

window.u = utils;

import { extend } from 'umi-request';
import request, { requestAdapter } from '@pxxtech/request';

request.extendOptions({
  adapter: requestAdapter(extend({ getResponse: true })),
});

window.t = (u: string, t: string) => {
  localStorage.setItem('pxx_userId', u);
  localStorage.setItem('pxx_accessToken', t);
};
